<template>
  <div id="app">
    <el-container>
      <el-aside width="200px" >
        <el-aside width="200px" >
          <el-menu
            default-active="2"
            class="el-menu-vertical-demo"
            background-color="#545c64"
            text-color="#fff"
            active-text-color="#ffd04b"
            v-if="show"
            router
          >
            <el-submenu index="1">
              <template slot="title">
                <i class="el-icon-location"></i>
                <span>基础管理</span>
              </template>

              <el-menu-item-group title="">
                <el-menu-item index="/shop">商品管理</el-menu-item>
              </el-menu-item-group>
            </el-submenu>

            <el-submenu index="2">
              <template slot="title">
                <i class="el-icon-location"></i>
                <span>订单管理</span>
              </template>

              <el-menu-item-group title="">
                <el-menu-item index="/transaction">交易订单</el-menu-item>
              </el-menu-item-group>
            </el-submenu>

            <el-submenu index="3">
              <template slot="title">
                <i class="el-icon-location"></i>
                <span>系统管理</span>
              </template>

              <el-menu-item-group title="">
                <el-menu-item index="/user">用户管理</el-menu-item>
                <el-menu-item index="/menu">菜单管理</el-menu-item>
                <el-menu-item index="/role">角色管理</el-menu-item>
                <el-menu-item index="/company">公司管理</el-menu-item>
                <el-menu-item index="/Environmental">系统环境变量</el-menu-item>
                <el-menu-item index="/jurisdiction">权限管理</el-menu-item>
              </el-menu-item-group>
            </el-submenu>
            <el-submenu index="4">
              <template slot="title">
                <i class="el-icon-location"></i>
                <span>支付管理</span>
              </template>

              <el-menu-item-group title="">
                <el-menu-item index="1-3">支付配置信息</el-menu-item>
                <el-menu-item index="1-3">支付配置</el-menu-item>
              </el-menu-item-group>
            </el-submenu>
          </el-menu>
        </el-aside>
      </el-aside>
      <el-container>
        <el-header>
          <el-menu
            class="el-menu-demo"
            mode="horizontal"
            background-color="#545c64"
            text-color="#fff"
            active-text-color="#ffd04b"
            v-if="show"
          >
            <el-button type="primary" round>退出登录</el-button>
          </el-menu>
        </el-header>
        <el-main>
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
   
  </div>
</template>

<style lang="scss">
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

#nav {
  padding: 30px;

  a {
    font-weight: bold;
    color: #2c3e50;

    &.router-link-exact-active {
      color: #42b983;
    }
  }
}
.el-menu-demo {
  height: 59px;
  // width: 80%;
}
// .el-button{
//   margin-right: 400px ;
// }
.add{
  height: 700px;
}
.el-header{
  padding: 0 -10px;
}
</style>

<script>
export default {
  data() {
    return {
      show: true,
    };
  },
  watch: {
    $route: {
      handler(newval, oldval) {
        if (newval.path == "/login") {
          this.show = false;
        } else {
          this.show = true;
        }
      },
    },
  },
};
</script>
